package com.sright.bcard.enterprise.dal.dao.impl;

import com.sright.bcard.common.service.share.base.dao.BaseDAOImpl;
import com.sright.bcard.common.service.share.base.dao.BaseMapper;
import com.sright.bcard.common.service.share.dto.page.PageParamRequest;
import com.sright.bcard.enterprise.dal.dao.AddressDAO;
import com.sright.bcard.enterprise.dal.entity.AddressDO;
import com.sright.bcard.enterprise.dal.mapper.AddressDOMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class AddressDAOImpl extends BaseDAOImpl<AddressDO> implements AddressDAO {

    @Resource
    private AddressDOMapper addressDOMapper;

    @Override
    public Integer count(PageParamRequest pageParamRequest) {
        return addressDOMapper.count(pageParamRequest);
    }

    @Override
    public List<AddressDO> pageList(PageParamRequest pageParamRequest) {
        return addressDOMapper.pageList(pageParamRequest);
    }

    @Override
    public int deleteAddress(Long id) {
        return addressDOMapper.deleteAddress(id);
    }

    @Override
    public List<AddressDO> selectByEnterpriseIdList(List<Long> enterpriseIdList) {
        return addressDOMapper.selectByEnterpriseIdList(enterpriseIdList);
    }

    @Override
    public List<AddressDO> selectByAddressIds(List<Long> addressIds) {
        return addressDOMapper.selectByAddressIds(addressIds);
    }

    @Override
    protected BaseMapper<AddressDO> getObjMapper() {
        return addressDOMapper;
    }
}
